﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EasyNetQ;
using EasyNetQ.Consumer;

namespace ZL.Web.Utility.MQ
{
    public class CrmDefaultConsumerErrorStrategy:DefaultConsumerErrorStrategy
    {


        public CrmDefaultConsumerErrorStrategy(
            IConnectionFactory connectionFactory, 
            ISerializer serializer, 
            IEasyNetQLogger logger, 
            IConventions conventions, 
            ITypeNameSerializer typeNameSerializer, 
            IErrorMessageSerializer errorMessageSerializer) : base(connectionFactory, serializer, logger, conventions, typeNameSerializer, errorMessageSerializer)
        {

        }

        public override AckStrategy HandleConsumerError(ConsumerExecutionContext context, Exception exception)
        {
            return AckStrategies.NackWithRequeue;
        }
    }
}
